Method and Apparatus for Hardware-Accelerated Encryption/Decryption

ABSTRACT

An integrated circuit for data encryption/decryption and secure key management is disclosed. The integrated circuit may be used in conjunction with other integrated circuits, processors, and software to construct a wide variety of secure data processing, storage, and communication systems. A preferred embodiment of the integrated circuit includes a symmetric block cipher that may be scaled to strike a favorable balance among processing throughput and power consumption. The modular architecture also supports multiple encryption modes and key management functions such as one-way cryptographic hash and random number generator functions that leverage the scalable symmetric block cipher. The integrated circuit may also include a key management processor that can be programmed to support a wide variety of asymmetric key cryptography functions for secure key exchange with remote key storage devices and enterprise key management servers. Internal data and key buffers enable the device to re-key encrypted data without exposing data. The key management functions allow the device to function as a cryptographic domain bridge in a federated security architecture.

CROSS-REFERENCE AND PRIORITY CLAIM TO RELATED APPLICATIONS

This patent application claims priority to provisional U.S. patent application Ser. No. 60/969,384, filed Aug. 31, 2007, and entitled “Method and Apparatus for Hardware-Accelerated Encryption/Decryption With Integrated Key Management”, the entire disclosure of which is incorporated herein by reference.

This patent application is related to pending U.S. patent application Ser. No. 11/690,034, filed Mar. 22, 2007, entitled “Method and System for High Throughput Blockwise Independent Encryption/Decryption”, and published as U.S. Patent Application Publication 2007/0237327, the entire disclosure of which is incorporated herein by reference.

FIELD OF THE INVENTION

The present invention relates generally to the field of data encryption/decryption, and more specifically to the field of hardware-accelerated data encryption/decryption.

BACKGROUND AND SUMMARY OF THE INVENTION

Data security is imperative for a broad spectrum of applications, particularly in the commercial and government sectors. Cryptography is one of the most trusted and widely used approaches for securing data in transit and data at rest. By obfuscating the data through a reversible transformation, encryption provides a way to ensure the confidentiality of data when the security of communication links or data storage devices cannot be guaranteed. For example, the Internet Protocol Security (IPsec) protocol encrypts IP packets, allowing confidential data to be transmitted over public IP networks.

Commercial and government organizations typically store their data using various types of Redundant Array of Independent Disks (RAID) configurations in order to maximize data availability. By partitioning data fields into small data units and striping the data blocks across parallel disk drives, RAIDs allow data to be stored and accessed faster than if it were stored on a single drive. RAIDs also provide various levels of error correction that guard against the failure of an individual drive in the array. When a drive fails, most systems allow an operator to replace the drive without interrupting the operation of the system. Some RAID configurations allow the RAID control device to automatically reconstruct the contents of the drive from the available error correction information.

While magnetic disk drives such as RAIDs represent a high-performance and relatively inexpensive medium for data storage, it should also be noted that such magnetic disk drives have a limited operational life. As such, commercial and government organizations must periodically discard old and/or failed magnetic drives. The vast stockpile of discarded and/or failed magnetic drives represents a significant security risk and liability for commercial and government enterprises. Even with failed drives, while some component of the drive may have failed, a significant amount of data may still be recovered from the magnetic disk. Drives may be sent to a destruction facility that physically grinds the drives into small pieces, but this is an expensive process and requires a significant amount of physical security measures to be implemented for the transport of the failed drives to such a facility. Encryption represents a more secure and cost effective option for securing stored data. By encrypting each data block prior writing it to disk and decrypting each data block after reading it from disk, stored data is obfuscated and protected from physical theft of the drive before or after drive failure. Cryptography may be employed in data communication and storage applications in a variety of other ways. The prior two examples simply highlight the tangible benefits. Other applications include securing digital voice, video, and image data.

A symmetric key block cipher is the most common type of cryptography employed for data confidentiality. Given a fixed-size block of input data (or plaintext) and a key, a block cipher produces a fixed-size block of encrypted output data (or ciphertext) using an unvarying transformation. A block cipher that uses the same key to encrypt and decrypt data is called a symmetric key block cipher. The Advanced Encryption Standard (AES) specified by the National Institute of Standards and Technology (NIST) is the Rijndael block cipher operating on data blocks of size 128 bits and using keys of size 128 bits, 192 bits, or 256 bits. Each transformation step in the Rijndael block cipher is referred to as a round. AES specifies the number of rounds based on the key size: 128 bit keys use 10 rounds, 192 bit keys use 12 rounds, and 256 bit keys use 14 rounds.

Despite advances in cryptographic algorithms, encryption and decryption remain computationally intensive tasks. For software applications running on general purpose processors (GPPs), adding a software implementation of encryption and decryption consumes a significant amount of processing resources, thus reducing the achievable performance of the application. One advantage of block ciphers such as AES block ciphers is their amenability to pipelined hardware implementation. In the case of AES, the inputs and processing of one round need not depend on the results of a subsequent round; i.e. there are no inherent feedback loops in the execution of the algorithm. A fully pipelined hardware implementation for AES could instantiate a series of 14 round circuits where each round circuit implements one round of the AES block cipher. An example of such an implementation is shown in FIG. 12. Depending on the key size in use, a supporting control circuit intercepts the state data at the appropriate round to be output as ciphertext. For a key size of 128 bits, the output of round 10 is used as the ciphertext. For a key size of 192 bits, the output of round 12 is used as the ciphertext. For a key size of 256 bits, the output of round 14 is used as the ciphertext. Regardless of key size, the pipelined block cipher circuit of FIG. 12 can be made to accept one block of data per clock cycle and only a single pass through the pipeline is needed to encrypt data. The resulting throughput for the circuit of FIG. 12 is the achievable clock frequency multiplied by the block size. A conservative estimate in current technology is a clock frequency of 200 MHz, resulting in a throughput of 25.6 Gbps (billion bits per second).

However, in many instances, the throughput needs of an encryption/decryption system will need to be balanced with the desired amounts of power consumption within the system. It should be noted that at higher clock frequencies and larger numbers of pipeline rounds, the power consumed by the block cipher when encrypting/decrypting data will increase. Therefore, the inventors herein believe that a need exists in the art for a block cipher design that is scalable to balance throughput goals against power consumption goals.

Toward this end, the inventors disclose as an embodiment of the invention a scalable block cipher circuit, wherein the scalable block cipher circuit is scalable to balance throughput with power consumption as desired by a practitioner of this embodiment of the invention. The scalable block circuit can be deployed on an integrated circuit, preferably as a hardware logic circuit on the integrated circuit. Optionally, this hardware logic circuit can be realized using reconfigurable logic. However, it should also be noted that this hardware logic circuit can be realized using non-reconfigurable logic (e.g., deployed as an application specific integrated circuit (ASIC)).

As used herein, “hardware logic circuit” refers to a logic circuit in which the organization of the logic is designed to specifically perform an algorithm and/or application of interest by means other than through the execution of software. For example, a GPP would not fall under the category of a hardware logic circuit because the instructions executed by the GPP to carry out an algorithm or application of interest are software instructions. As used herein, the term “GPP” refers to a hardware device that fetches instructions and executes those instructions (for example, an Intel Xeon processor or an AMD Opteron processor). Examples of hardware logic circuits include ASICs and reconfigurable logic circuits. The term “reconfigurable logic” refers to any logic technology whose form and function can be significantly altered (i.e., reconfigured) in the field post-manufacture. This is to be contrasted with a GPP, whose function can change post-manufacture, but whose form is fixed at manufacture. This can also be contrasted with those hardware logic circuits whose logic is not reconfigurable, in which case both the form and the function are fixed at manufacture (e.g., an ASIC, as mentioned above). An example of a reconfigurable logic circuit is a field programmable gate array (FPGA). Furthermore, the term “firmware” refers to data processing functionality that is deployed in a hardware logic circuit such as an ASIC or FPGA. The term “software” will refer to data processing functionality that is deployed on a GPP.

As another embodiment, the inventors disclose a block cipher circuit comprising a plurality of pipelined round circuits, wherein the block cipher circuit is configured to perform encryption and decryption utilizing the same order of round circuits within the pipeline regardless of whether encryption or decryption is being performed. Furthermore, such a block cipher circuit can employ multiplexers within a plurality of the round circuits to adjust the order of stages within each round circuit to accommodate both encryption and decryption operations. Further still, such a block circuit can employ on-the-fly key expansion and inverse expansion.

While the use of a strong block cipher, a large key size, and a clever encryption mode significantly reduces the probability of a successful attack on ciphertext, it should also be noted that key management is of equal importance in protecting the security of encrypted data. Key management represents one of the most challenging aspects of data security. As used herein, “key management” refers to the process of selecting, generating, authenticating, distributing, updating, and storing the keys used by a block cipher for encrypting/decrypting data. As used herein, “key management function” refers to a specific key management task (e.g., key generation, key distribution, etc.).

To address a perceived need in the art for improved key management security, the inventors disclose as an embodiment of the invention an integrated circuit configured to perform encryption/decryption, wherein the integrated circuit is also configured to perform a plurality of different types of key management functions (e.g., key management functions such as key selection, key generation, key authentication, key distribution, and key storage). The inventors also note that a challenge to integrating multiple type of key management functions into a single integrated circuit is the constraint as to the amount of space available on the integrated circuit. Thus, an efficient design for integrated key management is needed such as the inventive embodiments disclosed herein.

Further still, to increase the flexibility of encryption/decryption, the inventors disclose as an embodiment of the invention an integrated circuit configured to perform encryption/decryption wherein an encryption mode wrapper circuit is included on the integrated circuit for selectively performing additional operations on data going to and/or coming from the block cipher circuit to thereby define a desired encryption mode for the encryption operation. Preferably, the encryption mode wrapper circuit is realized as a hardware logic circuit on the integrated circuit.

Further still, the inventors disclose as an embodiment of the invention an integrated circuit configured to perform encryption/decryption wherein a data routing and control circuit is included on the integrated circuit for performing various data routing and control functions among the various circuits that are also included on the integrated circuit. Preferably, the data routing and control circuit is realized as a hardware logic circuit on the integrated circuit.

Further still, the inventors disclose as an embodiment of the invention an integrated circuit configured to perform encryption/decryption wherein volatile memory is included on the integrated circuit for temporarily storing any plaintext data that is needed by the integrated circuit during its operation, to thereby prevent exposure of plaintext outside the integrated circuit.

Further still, the inventors disclose as an embodiment of the invention an integrated circuit configured to perform encryption/decryption wherein volatile memory is included on the integrated circuit for temporarily storing any keys used by the block cipher circuit to encrypt/decrypt data, to thereby prevent exposure of the actual keys used by the block cipher for encryption/decryption outside the integrated circuit.

Further still, the inventors disclose as an embodiment of the invention an integrated circuit configured to perform encryption/decryption and a plurality of different types of key management functions, wherein the integrated circuit comprises a scalable block cipher circuit, an encryption mode wrapper circuit, a data routing and control circuit, and volatile memory for storing data and keys. Preferably, these circuits are realized as hardware logic circuits on the integrated circuit. The integrated circuit can also include a Direct Memory Access (DMA) engine circuit for reading data and commands into and writing data and commands out of the integrated circuit. The DMA engine circuit may also preferably be realized as a hardware logic circuit.

These and other features, advantages, and embodiments of the present invention will be apparent to those having ordinary skill in the art upon review of the following drawings and detailed description.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 depicts an integrated circuit configured to perform encryption/decryption utilizing a scalable block cipher circuit;

FIG. 2( a) depicts the integrated circuit of FIG. 1 enhanced with an encryption mode wrapper circuit;

FIG. 2( b) depicts the integrated circuit of FIG. 2( a) with an exemplary encryption mode wrapper circuit shown in greater detail;

FIG. 2( c) depicts the integrated circuit of FIG. 2( a) wherein the encryption mode wrapper circuit comprises an encryption mode processor;

FIG. 3 depicts the integrated circuit of FIG. 2( a) enhanced to perform a plurality of key management functions;

FIGS. 4( a) and (b) depict exemplary key storage environments in which the integrated circuit such as the one shown in FIG. 3 can be utilized;

FIG. 5 depicts an exemplary environment in which an integrated circuit such as the one shown in FIG. 3 can function as a cryptographic domain bridge;

FIGS. 6-11 depict exemplary process flows for key management functions that can be performed by the integrated circuit of FIG. 3;

FIG. 12 depicts an exemplary AES block cipher circuit that is fully pipelined;

FIG. 13( a) depicts an exemplary scalable AES block cipher circuit that employs pipelining and feedback;

FIG. 13( b) depicts an exemplary scalable AES block cipher circuit that employs pipelining and feedback with run-time scaling;

FIG. 14 depicts a dataflow diagram for the tweakable storage cipher (XTS) encryption mode;

FIG. 15 depicts an exemplary cryptographic hash circuit that utilizes a symmetric block cipher circuit;

FIGS. 16 and 17 depict exemplary XTS mode circuits;

FIGS. 18( a) and (b) depict exemplary timing diagrams for the block cipher circuit to perform encryption, including computations for the XTS mode;

FIGS. 19( a) and (b) depict a conventional ordering of stages within AES rounds for encrypting and decrypting data respectively with an AES block cipher circuit;

FIG. 20 depicts a sequential diagram that illustrates how data blocks can be processed through a pipelined scalable block cipher circuit having a depth of 5 rounds;

FIGS. 21( a) and (b) depict a conventional view of AES encryption and decryption respectively, including the order of stages within rounds;

FIGS. 22( a) and (b) depict the composition of rounds for a preferred embodiment of the block cipher circuit;

FIG. 23 depicts an exemplary round for a preferred embodiment of the block cipher circuit wherein the order of the column mixing stage and the add round key stage can be adjusted based on whether the round is to perform encryption or decryption; and

FIGS. 24, 25(a) and 25(b) depict exemplary process flows for creating a template to be loaded onto hardware logic for an integrated circuit to define one more hardware logic circuits thereon.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIG. 1 depicts an integrated circuit (IC) 150 that includes a block cipher circuit 103, a data routing and control circuit 102, a Direct Memory Access (DMA) engine circuit 101, and a scalable system interface circuit 100. Integrating these functions into a single IC 150 completely offloads the encryption and decryption tasks from other components in a system within which the IC 150 resides, thereby freeing up system resources to improve system performance or support additional tasks. The IC 150 also increases the security of the system by never exposing intermediate encryption results outside of the IC 150. The combination of the scalable system interface circuit 100 and DMA engine circuit 101 enables the IC 150 to be easily combined with a wide variety of processing architectures. This combination also allows the system interface to be easily scaled to match the performance requirements of the system and the block cipher circuit 103.

An example of a suitable platform upon which the IC 150 can be deployed in described in the above-referenced and incorporated U.S. Patent Application Publication 2007/0237327. However, it should be understood that other platforms could be used.

I. Block Cipher Circuit:

As one embodiment for the block cipher circuit 103, the inventors disclose a scalable block cipher circuit for inclusion in the IC 150. Preferably, this scalable block cipher circuit comprises scalable symmetric key block cipher circuit that comprises a plurality of pipelined round circuits for encryption/decryption, wherein the number of pipelined round circuits is specified at design time. Any block cipher encryption technique that is amenable to hardware implementation can be used for the scalable block cipher circuit, such as the triple data encryption algorithm (TDEA) and the AES algorithm. Block cipher circuits with fewer round circuits than the number of required rounds for the given key size require the data to make multiple passes through the circuit. For example, FIG. 13( a) shows a scalable AES block cipher circuit 1300 with seven round circuits 1302 where data must make two passes to encrypt/decrypt regardless of key size (e.g., whether the key size is 128/192/256 bits). As such, each round circuit 1302 can perform operations for multiple rounds of the encryption/decryption process, as denoted in FIG. 13( a), wherein the different rounds that each round circuit 1302 performs is depicted on each round circuit 1302. On average, circuit 1300 is able to accept a new data block 1308 every two clock cycles. Assuming a fixed clock frequency, this necessarily reduces the throughput of the circuit by a factor of two relative to the block cipher circuit of FIG. 12. The ability to scale the pipelined circuit with respect to its number of rounds 1302 allows the system to meet a given throughput goal while minimizing circuit size, cost, and power consumption.

In a preferred embodiment, the scalable block cipher circuit 103 is a hardware logic circuit. As examples, this hardware logic circuit can be deployed in reconfigurable logic or nonreconfigurable logic.

For systems with variable performance requirements, the circuit 1300 may be scaled to meet the maximum throughput goal. In situations where the throughput goal is reduced, the number of active round circuits 1302 may be reduced by disabling the clock to the round circuits 1302 at the end of the pipeline and feeding back the output of the last active round circuit 1302. This allows the system to minimize power consumption while retaining the ability to increase circuit throughput based on system demands.

Preferably, the scalable block cipher circuit is configured for either or both of two types of scaling: design-time scaling and run-time scaling. Design-time scaling allows the system designer to specify the depth of the processing pipeline in order to achieve a maximum throughput performance metric. In general, increasing the depth of the processing pipeline increases the maximum throughput of the block cipher. The system designer may choose the minimum pipeline depth that achieves a given performance metric. Reducing the depth of the pipeline reduces the size and dynamic power consumption of the block cipher circuit. Run-time scaling allows the system to dynamically adjust the depth of the pipeline by disabling pipeline round circuits. This allows the system to actively manage power consumption while retaining the ability to increase system throughput when necessary.

An example of a run-time scalable block cipher circuit would include a pipeline such as that shown in FIG. 12 or 13, but where there are feedback loops to the pipeline entry from the output of each round circuit to thereby allow the block cipher circuit to be scaled at run-time as desired based on which round circuit output is fed back. Two exemplary approaches that could be used for operating such a run-time scalable block cipher circuit are a tri-state bus for the feedback path and clock enable propagation. With clock enable propagation, one could accept a certain number of words per cycle, then propagate the clock enable signal along with the data, thereby eliminating the need for additional tri-state buffers or multiplexers.

FIG. 13( b) depicts an exemplary run-time scalable block cipher circuit 1350 which can operate to reduce the number of active round circuits 1302 at run time. The data state and round key outputs from each round circuit 1302 are connected to the data state and round key feedback buses 1352 and 1354 respectively via tri-state buffers 1356. When a buffer 1356 is enabled, that buffer drives its input value on the bus. When a buffer 1356 is not enabled, that buffer's input is disconnected from the bus. Similarly, the data state output of each round circuit is also connected to an output bus 1358. A power control circuit 1360 controls the enable signals to each tri-state buffer 1356, wherein these enable signals can be defined at run-time for the block cipher circuit 1350. In the example of FIG. 13( b), the power control circuit 1360 operates to enable 5 rounds of the 7 round pipeline (as shown by the highlighted tri-state buffers 1356 connected to the outputs of the fifth round circuit 1302). Furthermore, in this example, a 192-bit key is used, which therefore means that the data output of the 12^(th) round forms the cipher text. Thus, the power control circuit 1360 also operates to enable the tri-state buffer connected to the output of the second round circuit 1302 to drive bus 1358 when round 12 is completed (as shown by the highlighted tri-state buffer 1356 connected to the data output of the second round circuit 1302).

Data may be scheduled for input into the block cipher circuit 1300 in multiple ways. One mechanism is to use fixed time slot scheduling where input data 1308 is accepted on the first timing cycle. In general, the number of timing cycles is equal to the number of passes required to produce output ciphertext given the pipeline depth and the key size. In the configuration shown in FIG. 13( a), the number of timing cycles is two; input data 1308 and input key 1310 (state 1, round key 1) is accepted on the first timing cycle and first pass data 1304 and first pass key 1306 (state 8, round key 8) is accepted on the second timing cycle, then the cycle repeats. The multiplexers 1310 and 1312 at the head of the pipeline select input data and round keys on the first timing cycle, and feedback data and round keys on subsequent timing cycles, as specified by a command signal 1314 from control circuitry within the block cipher circuit. The fixed time slot scheduling approach allows the circuit 1300 to achieve a consistent data ingest rate.

Another mechanism for input data scheduling in multi-pass implementations is to dynamically multiplex data and keys into the first round, giving priority to data and keys on the feedback path (1304/1306). Data valid signals can be used to denote valid data on the input path (1308/1310) and the feedback path (1304/1306). On each clock cycle, these signals can be used in simple combinational logic to control the multiplexers 1310 and 1312 at the head of the pipeline. This approach allows contiguous input plaintext blocks to be ingested by the pipeline until the pipeline is full. It does require the ability to pause and possibly buffer the input data stream until the data in the pipeline completes its second pass.

As the number of pipeline round circuits 1302 decreases, the number of passes required diverges for different key sizes. For example, a pipeline depth of five requires two passes for 128 bit keys, but three passes for 192 bit and 256 bit keys. In general, design-time scaling allows the AES block cipher pipeline depth to range from 1 to 14. One mechanism for achieving design-time scaling is through the use of parameterized Hardware Description Language (HDL) code. Parameters in the code can be used to specify the pipeline depth. Conditional statements including those parameters can be used to instantiate the necessary round circuits and supporting control logic.

In order to provide the scalability described above, the block cipher circuit 103 can employ a novel design that supports encryption and decryption from a single circuit and implements on-the-fly key expansion for round key generation. An exemplary algorithm such as the AES algorithm involves rounds composed of four key stages: round key addition, byte substitution, shifting of rows, and mixing of columns. For encryption and decryption, each round consists of the same stages arranged differently. FIG. 19( a) shows the ordering of stages in each round for the encryption process. Note that the order of stages differs for the last round; the final mix columns stage is replaced with an add round key stage. FIG. 19( b) shows the order of stages in each round for the decryption process. Note that the order of stages differs for the first round; the mix columns stage is replaced by an add round key stage.

In order to maximize circuit utilization and minimize area and power consumption, the block cipher circuit 103 can include one instance of each stage per round to handle both encryption and decryption. Meta-information accompanies the data as it passes from round to round and from stage to stage within a round. The meta-information supplies the parameters of the desired AES operation. Included among exemplary meta-information are: the round key, key size, whether encrypting or decrypting, as well as an index of the current round. It is worth noting that, as a data block completes a round, the round key will have been expanded for the next round and the current round index will be incremented. The presence of meta-information reduces latency by allowing each round to operate under different parameters, rather than requiring the entire pipeline to operate under the same parameters until the completion of the specified operation. This is also what enables the AES circuit to be constructed with the variable depth round pipeline as previously discussed. Data leaving the last instantiated round of the pipeline could need to be looped back to the beginning of the pipeline, while new data could also be ready to enter the pipeline. The parameters of these two data states may vary greatly, if by nothing other than their respective round keys. When determining what data enters the pipeline, precedence is given to data needing to be looped through the pipeline. However, in an effort to fully utilize the pipeline (and therefore reduce latency) new data may enter the pipeline when no data is ready for an additional pass through the pipeline. An example is provided in FIG. 20. In this instance a five-round deep pipeline is to be used to encrypt a 3 Kb file with a fixed 128-bit key, thus ten rounds will be required to encrypt twenty-four 128-bit blocks. This figure is not meant to serve as a timing diagram, it is only to illustrate the use of meta-information. Since each round consists of four pipelined stages, it is possible for a round to include four 128-bit data blocks. The example also does not show the effect of stalls on the round pipeline. A 3 Kb file was chosen since this will ensure that a decision will be made concerning the propagation of new data and data requiring an additional pass through the circuit. A superscript is placed on the parameters to indicate the round in which they were produced; a superscript of zero signifies the initial value. In FIG. 20, the blocks will be output from the pipeline as they complete their second pass. Note that block F requires a second pass and will be looped back to the first round pipeline stage.

FIGS. 21( a) and 21(b) show the standard view of AES encryption and decryption. The figures show a ten-round, 128-bit key size, implementation, although the underlying concept of a round is applicable for all key sizes. By design, AES decryption is AES encryption in reverse. This presents two principle obstacles to having encryption and decryption coalesced in a single circuit. Most notably, the order of operations within a round is reversed from encryption to decryption. Furthermore, the last round of encryption is unique in that it does not utilize a mix columns stage in favor of an additional add round key stage. The final round of encryption is treated as a special case, however this requires that the first round of decryption be treated as a special case. Special cases and multiple possible data paths can quickly bloat the logic resources required to finalize a design in hardware.

To alleviate these limitations, a new notion of an AES round was formulated for a preferred embodiment of a scalable block cipher circuit. It is worth noting that the byte substitution and shifting of rows stages are interchangeable. The byte substitution stage is the direct mapping of each byte in the state to a corresponding fixed and predefined value, while the shifting of rows stage involves rotating the rows of the state based on the row number. Therefore, the order of these stages is irrelevant. The inventors further note that the byte substitution and shifting of rows stages could be combined into a single stage, along with universally shifting the grouping of stages to comprise a round. An embodiment of a scalable block cipher circuit can thus make use of the interchangeability of the byte substitution and the shifting of rows stages to conceptually “shift” the round boundaries in order to achieve a more consistent ordering of stages for both encryption and decryption. Due to this shifting, an initial add round key stage must be performed prior to entering the circuit's round pipeline. In a preferred embodiment for the scalable block cipher circuit, the special case round is now reserved for the last round when encrypting as well as when decrypting. FIGS. 22( a) and 22(b) illustrate the composition of rounds for a preferred embodiment of the scalable block cipher circuit. Thus, the order of the round circuits in the block cipher circuit of FIGS. 22( a) and (b) is fully independent with respect to whether encryption or decryption is performed.

By adopting the shifted view of an AES round, encryption and decryption begin to correlate and exhibit a design that is more befitting to hardware logic implementation. It is apparent that the order of the mix columns and add round key stages within a round are dependent upon whether the data block is being encrypted or decrypted. It is fairly straightforward in hardware to deploy multiplexers to allow for a single instantiation of each stage within a round, as shown in FIG. 23. A multiplexer placed in front of each of these stages can accept data (and meta-information) from the shifting of rows stage as well as from the output of the other stage. It is also necessary to feed each of these stages output to another multiplexer to determine the final output to exit the round. Each multiplexer determines which data to use based on whether the current round is encrypting or decrypting. This is an improvement over the standard view of an AES round, since the standard view would require that this configuration of multiplexers be duplicated at the head and tail of each round; thus requiring the instantiation of multiple mix columns and add round key stages within each round.

Each round of the block cipher requires a round key be derived from the original key by a defined technique for key expansion. A round key is 128-bits, regardless of specified key size, since it is to be applied to the 128-bit state of the round. For encryption, the round key of the first round is taken directly from the original key. Subsequent round keys are computed from the previous round key through a combination of exclusive- or operations, logical rotations, and byte substitutions. Key expansion also involves an exponentiation of 2, where the degree depends on the round. This is where the round index from the meta-information comes into play. The round index is also used, along with a maximum round value derived from the key size, to signal when execution is complete and the data block is ready to exit the AES pipeline.

A preferred embodiment of the block cipher circuit can also perform on-the-fly key expansion. The round key is only utilized in the round key addition stage of each round. By pipelining the layout of the block cipher, round keys may be expanded (or de-expanded in the case of decryption) within the round, prior to the round key addition stage. This requires that the initial encryption key be fed to the first round, and all necessary round keys will be expanded within the circuit. This improves latency for encryption since the AES circuit can begin executing immediately without waiting for the key to be pre-expanded.

Decryption is encryption in reverse, so the initial round key for decryption is the tail of the expanded encryption key. Utilizing similar techniques, a preferred embodiment of the block cipher circuit can also provide on-the-fly key expansion as well as on-the-fly key de-expansion. With such an embodiment, each encryption key, loaded into a key table by a key management processor (as explained hereinafter with respect to FIG. 3), will also have a corresponding decryption key loaded into the key table. This would involve expanding the encryption key based on the specified key size. The key management processor (which may be embodied as a hardware logic circuit) could handle this and load both the encryption and decryption key into the key table. Since key expansion in no way involves the cipher data, a relatively small sub-module could be implemented in hardware to arrive at a decryption key upon the loading of an encryption key to the key table.

II. Scalable System Interface Circuit:

In order to greatly simplify the integration of the scalable symmetric key block cipher circuit 1300 into standard system architectures, the inventors also disclose an IC 150 that includes a scalable system interface circuit 100. In general, the scalable system interface circuit 100 may be selected at design-time to be any standard or custom interface core. Its primary function is to act as a protocol bridge that presents a standard interface to the DMA engine circuit 101. Examples of system interface protocols include PCI, PCI-X, PCI Express, HyperTransport, and Infiniband. Some standard interface protocols such as PCI Express include scalability across a spectrum of performance points. The PCI Express protocol allows the number of 2.5 Gb/s bi-directional links to be 1, 4, 8, or 16. This allows the throughput of the system interface core to be scaled to match the throughput of the scalable block cipher. Given a system throughput goal, this scalability allows the integrated circuit to achieve minimum size and power consumption.

With reference to FIG. 1, input data flows across the input system interface 110, through the scalable system interface circuit 100, and across the DMA engine input interface 112. Output data is passed from the DMA engine output interface 113, through the scalable system interface circuit 100, and across the output system interface 111.

In a preferred embodiment, the scalable system interface circuit 100 is a hardware logic circuit. As examples, this hardware logic circuit can be deployed in reconfigurable logic or nonreconfigurable logic.

III. DMA Engine Circuit:

The DMA engine circuit 101 provides a mechanism for transferring data to and from the integrated circuit using memory transaction semantics. These memory transaction semantics provide flexibility in defining protocols for exchanging data and commands between the IC 150 and other system components. In a preferred embodiment, the DMA engine circuit 101 is a hardware logic circuit. As examples, this hardware logic circuit can be deployed in reconfigurable logic or nonreconfigurable logic.

The DMA engine circuit 101 preferably contains a set of configuration registers that are assigned a system address range at system initialization. These extensible registers define circuit configurations, specify the location of data buffer descriptors, and control the assertion of interrupts to the system. In addition to presenting a standard memory transaction interface to other system components, the DMA engine circuit 101 presents a standard data and command transfer interface to the data routing and control circuit 102. An example of a DMA engine circuit 101 that can be used in the practice of a preferred embodiment is the firmware socket module disclosed in pending U.S. patent application Ser. No. 11/339,892, filed Jan. 26, 2006, entitled “Firmware Socket Module for FPGA-Based Pipeline Processing”, and published as U.S. Patent Application Publication 2007/0174841, the entire disclosure of which is incorporated herein by reference. While a preferred embodiment disclosed in the Ser. No. 11/339,892 application is for deployment on an FPGA, the firmware socket module disclosed therein could also be used for deployment on other devices, including ASICs, as would be understood by those having ordinary skill in the art.

With reference to FIG. 1, input commands and data are passed from the DMA engine circuit 101 to the data routing and control circuit 102 across interface 114. Output commands and data are passed from the data routing and control circuit 102 to the DMA engine circuit 101 across interface 115.

IV. Data Routing and Control Circuit:

The data routing and control circuit 102 manages data destined for to and emanating from the scalable symmetric block cipher circuit 103. Functions for the data routing and control circuit 102 include processing commands that direct the IC 150 to load a key, set the key size, encrypt data, and decrypt data. With reference to the embodiment of FIG. 1, input plaintext blocks and keys are passed to the scalable symmetric block cipher circuit 103 across input interface 116, and output ciphertext blocks are passed from the scalable symmetric block cipher circuit 103 to the data routing and control circuit 102 across interface 117. Keys and control signals and passed between the data routing and control circuit 102 and the scalable symmetric block cipher circuit 103 across interface 124.

In a preferred embodiment, the data routing and control circuit 102 is a hardware logic circuit. As examples, this hardware logic circuit can be deployed in reconfigurable logic or nonreconfigurable logic.

V. Encryption Mode Wrapper Circuit:

Encryption modes generally define additional transformations to apply to the inputs and outputs of a block cipher. Modes are typically used to improve security, but may also be used to improve performance or extend functionality by addition authentication. Examples of encryption modes include cyclic block chaining (CBC), tweakable storage cipher (LRW and XTS), counter (CTR), and others. An example of such “other” encryption modes is the encryption technique disclosed in the above-referenced and incorporated U.S. Patent Application Publication 2007/0237327, entitled “Method and System for High Throughput Blockwise Independent Encryption/Decryption”. Another example of an encryption mode is the electronic code book (ECB) mode of encryption, wherein the output of a symmetric key block cipher is directly utilized as the ciphertext. However, relative to other encryption modes, with ECB, no additional transformations on the inputs and outputs of the block cipher are needed.

FIG. 2( a) depicts an IC 250 wherein an encryption mode wrapper circuit 200 is in communication with the inputs and outputs of the scalable block cipher circuit 103 to selectively define an encryption mode from a plurality of possible encryption modes for IC 250. Based on a control signal over interface 302 from the data routing and control circuit 102, the encryption mode wrapper circuit can select which additional transformations will (or will not in the case of ECB) be performed on the input to and/or output from the block cipher circuit 103. In a preferred embodiment, the encryption mode wrapper circuit 200 is a hardware logic circuit. As examples, this hardware logic circuit can be deployed in reconfigurable logic or nonreconfigurable logic.

As one example of an encryption mode that can be employed by the encryption mode wrapper circuit, FIG. 14 shows a dataflow diagram of the tweakable storage cipher (XTS) mode. XTS is designed to operate on independent fixed sized data units. A data unit number (logical storage block number) i is encrypted using a unique tweak key K_(T) to generate a tweak value T. For each 128-bit data block in the data unit, P_(j), the “tweak” value T is multiplied by the j-th power of a primitive element in the field GF(2¹²⁸), where j is the relative position of the 128-bit data block in the data unit. The resulting value T_(j) is combined with the 128-bit data block P_(j) using a bitwise exclusive-OR operation prior to input to the AES block cipher. The same “tweak” is combined with the 128-bit output of the block cipher C′_(j) using a bitwise exclusive-OR operation to produce the ciphertext C_(j). The multiplication and bitwise exclusive-OR operations can be performed by the encryption mode wrapper circuit on data destined for and returning from the block cipher circuit 103 to thereby achieve the desired XTS effect. Furthermore, the block cipher circuit 103 can optionally be utilized beforehand to generate the tweak value T.

Shown in FIG. 2( b) is a block diagram of an IC 250 with an encryption mode wrapper circuit 200 that supports multiple encryption modes with a plurality of encryption mode circuits using a shared block cipher circuit 103. In the example of FIG. 2( b), the encryption mode circuits comprise an XTS mode circuit 204, a CBC mode circuit 205, and a CTR mode circuit 206. The selection of which encryption mode circuits will be included in the encryption mode wrapper circuit 200 can be made at design time. Also, it should be understood that more or fewer as well as different encryption mode circuits could be included in the encryption mode wrapper circuit 200.

In the example of FIG. 2( b), the data routing and control circuit 102 is extended to route data to and from the multiple encryption mode circuits. The data routing and control circuit 102 passes input data to encryption mode circuits 204, 205, and 206 across interface 216. This input interface may be monitored by all encryption mode circuits, as a given input data block will processed by one encryption mode circuit. Thus, the encryption mode wrapper circuit 200 can be configured such that all encryption mode circuits operate on all data, where the output of the appropriate encryption mode circuit can be passed as output based on a control signal delivered to a multiplexer by the data routing and control circuit. Another way to control which encryption mode circuit is effectively utilized is to pass an input data valid signal synchronous to the data to the appropriate encryption mode circuit, wherein the encryption mode circuits will only input data from interface 216 when their input data valid signal is asserted. Also note that interface 216 may deliver data directly to the block cipher in the event that an encryption mode circuit is not used for data inbound to the block cipher. Multiplexer 218 selects data for the scalable symmetric block cipher input among encryption mode output interfaces and interface 216 (no encryption mode) based on a control interface 220 from the data routing and control circuit 102. The same control interface 220 controls the selection of output ciphertext using multiplexer 219. The output of the scalable symmetric block cipher circuit is passed to the encryption mode circuits across interface 217. This output interface may be monitored by all encryption mode circuits, as a given output data block will be processed by one encryption mode circuit, with the same processing options for the different encryption mode circuits as explained above. Interface 217 also passes data directly to multiplexer 219 for the case that an encryption mode circuit is not used for data outbound from the block cipher. It should be noted that if the no encryption mode circuits are used to perform additional transformations on data going to and coming from the block cipher circuit, this effectively amounts to the ECB mode of encryption.

A circuit design for XTS mode circuit 203 in FIG. 2( b) is shown in FIG. 16 as circuit 1601. The scalable symmetric block cipher circuit 103 in FIG. 2( b) is shown as AES block cipher 1600 in FIG. 16. Block cipher 1600 contains a pipeline of n rounds, where n is chosen to meet the system throughput requirements as previously described. Circuit 1601 contains a scalable AES block cipher 1602 in order to compute tweak values in parallel to data block encryption and decryption. It should be noted that AES block cipher 1602 is not the same block cipher as block cipher circuit 103 which also shares the integrated circuit. The system passes the data unit number i for a pending data unit to the mode circuit. AES block cipher 1602 computes tweak value T using symmetric tweak key K_(T). Tweak values T are stored in buffer 1603 until the first block of the data unit is input to the mode circuit. Block cipher 1602 is scaled to meet the data unit throughput requirements of the system. Given that data units contain multiple blocks, the data unit throughput requirement will be less than the data block throughput requirement. Cipher 1602 may therefore be scaled to contain fewer pipeline round circuits, consuming less area and power. By containing an independent block cipher for tweak computation and pre-processing tweak values, circuit 1601 maximizes the achievable throughput of the system by allowing a new data block to be input to scalable block cipher 1600 every clock cycle. For each data block, P_(j), the tweak value T is multiplied 1604 by the j-th power of a primitive element in the field GF(2¹²⁸) to generate value T_(j). (The tweak value T may be retrieved from the buffer and stored in a register until all data blocks of the data unit are processed.) The value T_(j) is combined with data block P_(j) using a bitwise exclusive-OR 1605 to produce value P′_(j). Value P′_(j) is passed to AES block cipher 1600 along with symmetric data key K_(B). Value T_(j) is stored in buffer 1606 until associated ciphertext block C′_(j) is output from block cipher 1600. Value T_(j) is then retrieved from buffer 1606 and combined with ciphertext block C′_(j) using bitwise exclusive-OR 1607. The resulting ciphertext block C_(j) is output from the circuit.

FIG. 17 shows an alternative circuit design 1701 for XTS mode circuit 203 in FIG. 2( b). Circuit 1701 does not include an independent block cipher for tweak computation, allowing for a smaller circuit with less power consumption. Circuit 1701 uses block cipher circuit 103 (shown as block cipher 1700 in FIG. 17) for computing tweak values. Thus, circuit 1710 schedules tweak value computations between data unit encryption computations using scheduler circuit 1702. Input buffers 1703-1706 store keys, data blocks, and data unit numbers while they await processing by the circuit. Scheduler 1702 controls the flow of keys and data to block cipher 1700 by multiplexing data blocks and data unit numbers using multiplexer 1709 and multiplexing data keys and tweak keys using multiplexer 1708. For a tweak computation, the next data unit number is retrieved from buffer 1705 and passed to block cipher 1700 via multiplexer 1709. The associated tweak key is retrieved from buffer 1703 and passed to block cipher 1700 via multiplexer 1708. When a tweak value T is output from block cipher 1700, it passes through gate 1710 and is stored in buffer 1711. For data encryption computations, tweak value T is retrieved from buffer 1711 and is multiplied 1712 by the j-th power of a primitive element in the field GF(2¹²⁸) to generate value T_(j). Note that the value j may be produced by the scheduler as it is simply the data block number within the data unit. Alternatively, the j values may be queued along with data blocks. The value T_(j) is combined with data block P_(j) using exclusive-OR 1707 to produce value P′_(j). Value T_(j) is also stored in buffer 1713. Value P′_(j) passes through multiplexer 1709 to block cipher 1700. Likewise, data key K_(B) passes through multiplexer 1708 to block cipher 1700. When value C′_(j) is output from block cipher 1700, value T_(j) is retrieved from buffer 1713 and the values are combined using exclusive-OR 1714 to produce output ciphertext C_(j).

It should be noted that circuit 1701 may be pipelined such that once the tweak value T is computed, a new data block from the given data unit may be passed to the block cipher 1700 on each clock cycle. The goal of the scheduler circuit is to minimize the overhead of sharing the block cipher for tweak computation. A variety of scheduling techniques may be used. FIGS. 18( a) and (b) provide three examples where the pipelined block cipher requires n time steps to complete a block encryption operation, but a new block may be passed to the cipher at each time step. The examples also assume that the number of data blocks in a data unit b is less than the number of pipeline rounds in the block cipher n. FIG. 18( a) shows the amount of time required to completely process a single data unit. The tweak computation requires n time units. The first data block is passed to the cipher at time step n. The first ciphertext block emerges from the block cipher at time unit 2 n. The last ciphertext block emerges from the block cipher at time unit 2 n+b. If the scheduler waits until the last ciphertext block emerges from the block cipher to begin the next computation, then the circuit will process one data unit every 2 n+b time units. This may be necessary in cases where the pipelined block cipher is unable to process blocks with different keys at the same the time; i.e., The pipeline must be flushed prior to changing the key.

Note that the scalable symmetric block cipher circuit disclosed herein may also be pipelined in such a way as to allow a new key to be loaded with each input data block. With reference to FIG. 18( a), the data unit number of the next data block could be input to the system on cycle n+b. This would allow the system to process one data unit every n+b cycles.

It should further be noted that only one pipeline round is active while the tweak value is computed. As shown in FIG. 18( b), the scheduler may use these cycles to pre-compute tweak values for pending data units. The scheduler may compute n tweak values without inducing any additional delay on the pending data units. When n data units are available for pre-computation, the circuit will process n data units every n+(n−1)b time units. For example, assume a time unit is 5 nanoseconds (200 MHz clock), a data unit is 512 bytes (contains 32 16-byte data blocks), and the block cipher pipeline is 40 stages deep. In this case the circuit would process 20 data units every 1288 cycles (6.44 microseconds), or 1.6 billion bytes per second.

FIG. 2( c) depicts an IC 250 wherein the encryption mode wrapper circuit 200 includes an encryption mode processor (EMP) 207. The functionality of EMP 207 is preferably defined by firmware and provides support for a broad range of encryption modes (wherein the firmware defines additional transformations on the inputs and outputs of the block cipher circuit 103). The EMP 207 also allows new encryption modes to be added post manufacture. The computational complexity of the additional transformations defined by encryption modes is expected to be significantly less than that of the block cipher. This allows a simple EMP circuit 207 to match the performance of the block cipher 103. A wide variety of embedded processor designs are suitable for the EMP.

VI. Key Management:

A strong block cipher, large key size, and clever encryption mode significantly reduces the probability of a successful attack on the ciphertext. Properly managing the creation, allocation, storage, and distribution of keys is of equal importance. If an attacker can easily gain access to a key or set of keys, encrypted data may be compromised without the need for sophisticated cryptanalysis. There are a wide variety of key management systems that typically adhere to a set of well-accepted guidelines. The guidelines include choosing random values for keys, regularly rotating the keys (encrypting data with a new key), protecting keys during storage and transmission, and guarding against component failures in the system. As shown in FIG. 3, the inventors disclose as an embodiment of the invention an IC 350 that includes several key management functions which offload other system components and increase the security of the system by only exposing keys inside of the IC 350.

The IC 350 builds upon the ICs shown in FIG. 1 and FIG. 2. The IC 350 includes one or more encryption mode circuits (e.g., XTS mode circuit 204) as well as one or more additional circuits that are configured to provide key management functionality (e.g., circuits 305 and 306). In a preferred embodiment, circuits 305 and 306 are hardware logic circuits. As examples, these hardware logic circuits can be deployed in reconfigurable logic or nonreconfigurable logic.

In addition to extending the set of circuits sharing the scalable block cipher circuit 103, the IC 350 adds a data buffer 307, key table 308, key management processor (KMP) 309, and non-volatile random access memory (NVRAM) interface 328. All of these components interface to the data routing and control circuit 102. While the data buffer 307 and key table 308 may take the form of non-volatile memory, preferably volatile memory is used for buffer 307 and/or table 308 to enhance security. The data buffer 307 allows keys to be rotated without exposing plaintext outside of the IC 350. The key table 308 allows a large number of keys and their associated meta-data to be stored and quickly accessed by other components in the IC 350. The NVRAM interface 328 allows keys to be stored in a secure non-volatile device accessible only by the IC 350. The KMP 309 is responsible for loading keys into the key table and reading keys out of the key table for storage or transfer.

The KMP 309 may directly load keys generated by circuits on the IC 350 into the key table 308, ensuring that keys are never exposed outside of the IC 350. The KMP 309 may also load keys from the NVRAM interface 328. The KMP 309 may also implement a key transfer protocol with a remote key server to load keys from the remote key server into the key table 308 or read keys from the key table 308 and encrypt them prior to transfer to a remote key server for storage. FIG. 4( a) and FIG. 4( b) show examples of key storage options.

In most data security applications, key load and key transfer are rare tasks relative to encryption and decryption of data blocks. In this case the KMP 309 may be implemented as an embedded instruction processor whose function is defined by firmware. Example functions include asymmetric key cryptography (AKC), also known as public key cryptography. In public key cryptography, a pair of keys (private and public) are used to encrypt and decrypt data. As implied by the names, the private key is kept secret and the public key is made freely available. Data encrypted with the private key may be decrypted with the public key. It is prohibitively difficult to reproduce a given encrypted data block without the private key. Used in this way, AKC provides an authentication mechanism for data receivers to verify that a message was produced by the sender. Data encrypted with the public key may only be decrypted with the private key. Used in this way, AKC provides a secure one-way communication from public key holders to the private key holder. Key exchange and shared key establishment protocols also utilize public key cryptography. The KMP 309 may be configured to perform any of these functions in support of a specific key management architecture.

The additional key management features provided in the IC 350 enable the IC 350 to be easily integrated in a broad spectrum of applications and key management systems. The modularity and flexibility of the key management functions allow the key management architecture to be changed over time to address emerging security concerns. The additional key management features also allow the device to act as a cryptographic domain bridge in a federated security architecture. As shown in FIG. 5, a federated security architecture allows multiple security domains to be defined where each domain may define its own encryption and key management policies. For example, with reference to FIG. 5, data in domain A is encrypted with AES-XTS and the 256-bit symmetric keys are encrypted and stored on media (e.g., RAIDs). Data in domain B is encrypted using AES-CTR and the 128-bit keys are stored on a centralized key server. The IC 350 functions as a cryptographic domain bridge for data flowing across the domain boundary by decrypting data using the algorithm and key specified by the source domain then encrypting data using the algorithm and key specified by the destination domain.

An example of a key management function that can be provided by IC 350 is key rotation. With key rotation, the encryption keys used to secure the data are periodically changed. Data buffer 307 allows the IC 350 to support key rotation without exposing plaintext data outside of the integrated circuit. Data is first decrypted using the existing key. The data routing and control circuit 102 routes the decrypted data blocks to data buffer 307 across interface 325. Data buffer 307 is not accessible from outside the integrated circuit and its contents are erased when power is removed. Once the decryption operation is complete, the plaintext data blocks are routed back through the encryption circuits, encrypted using a new key, and transferred out of the IC 350. Note that in addition to changing the key used to secure the data, the encryption mode may also be changed. The data routing and control circuit 102 manages the process of passing the correct key to the scalable symmetric block cipher circuit 103 via interface 324, selecting the appropriate encryption mode via control interfaces 320-321, and routing data to and from the data buffer 307 via interface 325, the cryptography circuits via interfaces via interfaces 316-317, and the DMA engine circuit 101 via interfaces 314-315.

Another key management function that can be provided by IC 350 is key generation. The IC 350 can provide support for secure key generation using the RNG circuit 305. In a preferred embodiment, a key generation command from the key management application contains a seed value and a destination index that specifies the location in the key table 308 to store the generated key. The command is received by the system interface circuit 100 and passed to the data routing and control circuit 102. The data routing and control circuit 102 passes the specified seed to the RNG circuit 305 via interface 316 and directs the RNG circuit to produce a key of a specified value via control interface 322. The key is returned to the data routing and control circuit which stores the key in the specified index in the key table 308 via interface 326.

There are a wide variety of techniques for generating pseudo-random sequences given a seed value. Several techniques do not require a block cipher, such as a linear feedback shift register (LFSR) with a prime polynomial feedback function. A preferred embodiment for the RNG circuit 305 utilizes the seed value as a key for the symmetric block cipher and the output of a free-running counter as the data input. Arbitrarily long random values may be constructed by concatenating the output ciphertext.

The IC 350 also contains a cryptographic hash circuit 306 that may be used for key authentication and key generation. Key authentication involves ensuring that a received key is from a known source. The input to the hash circuit 306 is an arbitrary length “message”. The output of the hash circuit is a fixed-length digest. Thus, given the arbitrary length input text, a cryptographic hash function circuit 306 produces a fixed length digest, wherein the hash function has the properties that it is prohibitively difficult to reconstruct the original input text given the digest, and it is prohibitively difficult to choose two input texts that produce the same digest. These properties are useful for key generation from input pass phrases, data validation, and data authentication using digital signatures.

In a preferred embodiment the symmetric block cipher circuit 103 is used to compute the cryptographic hash. A diagram of a cryptographic hash circuit 306 that utilizes a symmetric block cipher circuit is shown in FIG. 15. It should be noted that this block cipher circuit is the integrated circuit's block cipher circuit 103. The message is partitioned into blocks and input to the block cipher. The output digest is the concatenation of the final j hash values produced by the circuit, where j is at least one and at most the number of blocks in the input message. Hash value i, H_(i), is the result of the bitwise exclusive-OR of block i of the message, M_(i), and the ciphertext produced by encrypting M_(i) using the previous hash value H_(i-1) as the key. Other block cipher-based cryptographic hash circuits are feasible; FIG. 15 is exemplary.

The IC 350 also contains a key table memory 308 that provides storage for a large number of encryption keys and associated meta-data. Examples of key meta-data include key size and timestamp. Key size specifies the size of the key and is used to properly configure the scalable symmetric block cipher circuit 103. Key timestamp specifies the time of key creation and can be used to manage key lifecycle. The key timestamp may be included with the key when it is transferred into the IC 350, or written by the IC 350 when the IC 350 generates the key. Each storage location in the key table is a key index. Stored at each key index may be an encryption key, a pre-expanded decryption key, and associated key meta-data. System commands may specify the key to use for a particular cryptography operation by specifying the key index instead of explicitly passing the key. The inclusion of a key table 308 prevents the need to transfer keys prior to every operation, reducing the latency of the operation by providing immediate access to the required key.

The meta-data fields in a key table entry may also be extended to include configuration data such as encryption mode parameters. For example, the meta-data fields may include encryption mode, data unit size, and an additional mode key. Associating meta-data with a key simplifies the system control semantics, allowing the system to specify the key index and a pointer to the data. The meta-data is fetched by the DMA engine circuit 101 and the key index is used to retrieve all of the configuration parameters that dictate the processing of the data.

Note that while the IC 350 shows only one encryption mode circuit (XTS mode circuit 204), the IC 350 may be extended to include additional encryption mode circuits or an encryption mode processor as shown in FIGS. 2( b) and (c). Additional cryptography functions that utilize a symmetric block cipher other than the RNG circuit 305 and hash circuit 306 may also be added.

The IC 350 also contains a key management processor (KMP) 309. The KMP 309 may be a fixed circuit, but in a preferred embodiment the KMP 309 is an embedded instruction processor whose behavior is defined by firmware. Examples of suitable embedded instruction processors include ARM and LEON processors. The KMP 309 allows keys to be transferred into and out of the IC 350 using a wide variety of key transfer protocols. The advantage of a firmware programmable processor is the ability to modify the key management functions supported by the IC 350, post-manufacture. In addition to supporting secure key transfer into and out of the IC 350, the KMP 309 can also be configured to perform key authentication and key encryption/decryption (key wrapping/unwrapping). Commands and data are transferred to and from the KMP via interface 326 that links the data routing and control circuit 102 and the key table 308. The KMP manages the reading and writing of keys to/from the key table from external sources. The KMP ensures that keys transferred out of the IC 350 are encrypted using a Key Encryption Key (KEK) or shared session key established through a suitable key exchange protocol. Examples of public key cryptography techniques that may be implemented in the KMP for establishing session keys and transferring keys into and out of the IC 350 include RSA and elliptic curve cryptography (ECC).

The IC 350 also includes an interface circuit 328 to a non-volatile random access memory (NVRAM) device. An NVRAM device may be included in the IC 350 or included in the system as an additional component with a secure, point-to-point interface with the IC 350. The NVRAM device provides storage for keys, KEKs, and firmware for embedded processors in the IC 350. In a preferred embodiment, the firmware for the KMP and EMP, if present, are read out of the NVRAM device through the NVRAM interface circuit 328 when power is applied to the IC 350. Simple boot programs in the embedded processors issue read commands that are routed through the data routing and control circuit 102, across interface 327, to NVRAM interface circuit 328. Read responses are routed back to the embedded processors by the data routing and control circuit. The KMP may issue key read and write commands to the NVRAM interface in cases were keys or KEKs are stored in the NVRAM.

FIG. 4( a) depicts an exemplary system that includes the integrated circuit 350 in the storage controller 401 of a secure file server 400. The secure file server stores data on one or more arrays of high-speed disks 402. The storage controller 401 includes an Input/Output (IO) Processor 403 that connects to the disk array via interconnect 410 and links to the rest of the file server via system interface 411. The encryption and key management IC 350 enables the storage controller 401 to encrypt all data written to the disk array and decrypt all data read from the disk array without reducing the data throughput. Data is transferred between the IC 350 and IO Processor via interface 412.

FIG. 4( a) also highlights a variety of options for symmetric key and KEK storage. The location of keys within the system is dictated by the key management architecture. The storage controller 401 may include a secure NVRAM device 405 for symmetric key, KEK, and firmware storage. The secure file server may also include a secure NVRAM device 406 for key and KEK storage. The secure file server may also include a network interface 414 to a remote key server 407 that securely stores symmetric keys and KEKs. Key transfers to and from the remote key server are executed by the key management processor (KMP) in the IC 350.

FIG. 4( b) depicts an exemplary system that includes the IC 350 in the network interface controller 501 of a secure network firewall 500. In this system, the IC 350 interfaces with a network processor 503 that also includes interfaces to external communication links 515 and the firewall system 511. Like the secure file server example in FIG. 4( a), the example in FIG. 4( b) shows a variety of key and KEK storage options, including a remote key server 507.

FIGS. 6-11 illustrate a plurality of different exemplary key management functions that the IC 350 can perform. These key management functions provide the IC 350 with the ability to securely load keys into the IC 350 and transfer keys out of the IC 350 using the flexible KMP. It should be noted however, that the IC 350 can be configured to perform additional and/or different key management functions if desired by a practitioner of this embodiment of the invention.

FIG. 6 illustrate a process flow for loading symmetric keys wrapped with a KEK, wherein the KEK is derived from a user-supplied pass-phrase, and wherein the KEK-wrapped symmetric keys are stored in an NVRAM device. At step 600, a key load command containing a user-supplied pass-phrase is passed to the IC 350. The pass-phrase is passed to the cryptographic hash circuit 306 for generation of the digest therefrom (step 602). The resulting digest is the key encryption key (KEK) that is loaded into the symmetric block cipher circuit 103. First, however, the KEK is verified at step 604. There are a variety of ways to ensure that the KEK generated from the pass-phrase is the same KEK used to wrap the keys that are on the NVRAM device. Of course, the appropriate pass-phrase must be used for the KEK to be successfully generated. Furthermore, this KEK may be used to encrypt a known value (which can be referred to as a “cookie”). This encrypted known value can be stored on the NVRAM with the wrapped keys. The verify step 604 would then decrypt the known value and check for its correctness. If the decrypted value is not equal to the known value, the IC will respond with an error command (step 606) and not decrypt the wrapped keys.

Following successful verification, an encrypted key is read from the NVRAM device and passed to the symmetric block cipher circuit at step 608. At step 610, the block cipher circuit 103 decrypts the symmetric key using the KEK. The KMP then stores the decrypted symmetric key in the key table location specified by the command (step 612). If the command specified multiple keys to be loaded, the process repeats (step 614 to step 608), but the KEK need not be regenerated. Once all keys are read, decrypted, and loaded into the key table, the KMP generates a command acknowledgement that is returned to the system (step 616).

FIG. 7 illustrates a process flow for loading symmetric keys wrapped with a KEK, wherein the KEK is stored in a secure NVRAM device accessible only to the IC 350. A key load command containing one or more KEK-wrapped symmetric keys is passed to the IC 350 (step 700). A register may be used to store the current KEK. At step 702, if that register value is not valid, then the KEK is read from the NVRAM device (step 704). The KEK is loaded into the symmetric block cipher circuit 103 and KEK register. The encrypted symmetric key is also passed to the symmetric block cipher. At step 706, the block cipher circuit 103 decrypts the KEK-wrapped symmetric key using the KEK. The KMP then stores the decrypted symmetric key in the key table location specified by the command (step 708). If the command specified multiple keys to be loaded, the process repeats (step 710 to step 700), but the KEK need not be reloaded. Once all keys are decrypted and loaded into the key table, the KMP generates a command acknowledgement that is returned to the system (step 712).

FIG. 8 illustrates a process flow for transferring symmetric keys out of the key table where each key is encrypted prior to transfer using a KEK that is stored in the NVRAM device. A key read command specifying one or more table indexes to read is passed to the IC 350 at step 800. The KMP reads the first symmetric key from the key table at the index specified by the command (step 802). A register may be used to store the current KEK. If step 804 results in a finding that the register value is not valid, then the KEK is read from the NVRAM (step 806). Once the register value is valid, the KEK is loaded into the symmetric block cipher circuit 103, and the block cipher circuit 103 encrypts the symmetric key using the KEK (step 808). If the command specified multiple keys to be read, the process repeats (step 810 to step 802), but the KEK need not be reloaded. Once the keys are encrypted, they are transferred out of the IC 350 as a command response (step 812).

FIG. 9 illustrates a process flow for loading symmetric keys using public key cryptography, where the symmetric keys are encrypted with the advertised public key and decrypted with the private key. At step 900, a public-private key generation command is passed to the IC 350, instructing it to generate an ephemeral key pair for a secure key transfer session. The KMP then generates a public-private key pair (step 902) and returns the public key with the command response (step 904). A register may be used to store the private key. A subsequent key load command containing one or more encrypted symmetric keys is passed to the IC 350 (step 906). The KMP decrypts the symmetric key using the private key of the ephemeral pair (step 908). The KMP then loads the symmetric key into the key table at the specified index (step 910). If the command specified multiple keys to be loaded, the process repeats (step 912 to step 906). Once all keys are decrypted and loaded into the key table, the KMP generates a command acknowledgement that is returned to the system (step 914).

FIG. 10 illustrates a process flow for loading symmetric keys using public key cryptography where the symmetric keys are encrypted with a shared key, wherein the shared key is derived from the advertised public keys. At step 1000, a public-private key generation command is passed to the IC 350, instructing it to generate an ephemeral key pair for a secure key transfer session. The KMP then generates a public-private key pair (step 1002) and returns the public key and shared key parameters with the command response (step 1004). A register may be used to store the private key and shared key parameters. A subsequent key load command containing one or more encrypted symmetric keys and the public key of the key sender is passed to the IC 350 (step 1006). The KMP derives the shared key using its key pair, the sender's public key, and the shared key parameters (step 1008) using a protocol such as ECC. Once derived, the KMP uses the shared key to decrypt the symmetric key (step 1010). The KMP then loads the symmetric key into the key table at the specified index (step 1012). If the command specified multiple keys to be loaded, the process repeats (step 1014 to step 1006), but the shared key need not to be derived again. Once all keys are decrypted and loaded into the key table, the KMP generates a command acknowledgement that is returned to the system (step 1016).

FIG. 11 illustrates a process flow for reading symmetric keys using public key cryptography where the symmetric keys are encrypted with a shared key, wherein the shared key is derived from advertised public keys. At step 1100, a public-private key generation command is passed to the IC 350, instructing it to generate an ephemeral key pair for a secure key transfer session. The KMP generates a public-private key pair (step 1102) and returns the public key and shared key parameters with the command response (step 1104). A register may be used to store the private key. A subsequent command containing the public key of the reading application (i.e., the destination of the encrypted keys), the shared key parameters, and the key table indexes to be read is input to the IC 350 at step 1106. Using the private and public keys, the sender's public key, and the shared key parameters, the KMP derives the shared key at step 1108 using a protocol such as ECC. At step 1110, the first symmetric key is read from the key table at the specified index. The KMP encrypts the key with the shared key (step 1112) and outputs the encrypted symmetric key (step 1114). If the command specified multiple keys to be read, the process repeats (step 1116 to step 1110), but the shared key need to be derived again. Once all keys are encrypted and transferred out of the IC 350, the KMP generates a command acknowledgement that is returned to the system (step 1118).

It should be noted that the preceding processes and associated flow diagrams for FIGS. 6-11 are exemplary and by no means exhaustive. The flexible key management capabilities of IC 350 provide for a wide variety of other key management functions to also be employed.

VII. IC Design:

To generate a firmware template for loading onto an FPGA, wherein the firmware template embodies one or more of the hardware logic circuits described herein for any of ICs 150/250/350, the process flow of FIG. 24 can be performed. First, code level logic 2400 for the desired hardware logic circuits that defines both the operation of the circuits and their interaction with each other is created. This code, at the register level, is preferably Hardware Description Language (HDL) source code, and it can be created using standard programming languages and techniques. As examples of an HDL, VHDL or Verilog can be used. Thus, with respect to the embodiment of FIG. 3, this HDL code 2400 could comprise a data structure corresponding to a combination of various IC circuits shown in FIG. 3.

Thereafter, at step 2402, a synthesis tool is used to convert the HDL source code 2400 into a data structure that is a gate level logic description 2404 for the hardware logic circuits. A preferred synthesis tool is the well-known Synplicity Pro software provided by Synplicity, and a preferred gate level description 2404 is an EDIF netlist. However, it should be noted that other synthesis tools and gate level descriptions can be used. Next, at step 2406, a place and route tool is used to convert the EDIF netlist 2404 into a data structure that comprises the template 2408 that is to be loaded into the FPGA. A preferred place and route tool is the Xilinx ISE toolset that includes functionality for mapping, timing analysis, and output generation, as is known in the art. However, other place and route tools can be used in the practice of the present invention. The template 2408 is a bit configuration file that can be loaded into an FPGA through the FPGA's Joint Test Access Group (JTAG) multipin interface, as is known in the art. Other techniques for loading the template into the FPGA include loading from an attached non-volatile memory device, e.g., Electrically Erasable Programmable Read Only Memory (EEPROM), and loading the template from an attached reconfigurable logic device (e.g., another FPGA).

However, it should also be noted that the process of generating template 2408 can begin at a higher level, as shown in FIGS. 25( a) and (b). Thus, a user can create a data structure that comprises high level source code 2500. An example of a high level source code language is SystemC, an IEEE standard language; however, it should be noted that other high level languages could be used. Thus, with respect to the embodiment of FIG. 3, this high level source code 2500 could comprise a data structure corresponding to a combination of various IC circuits shown in FIG. 3.

At step 2502, a compiler such as a SystemC compiler can be used to convert the high level source code 2500 to the HDL code 2400. Thereafter, the process flow can proceed as described in FIG. 24 to generate the desired template 2408. It should be noted that the compiler and synthesizer can operate together such that the HDL code 2400 is transparent to a user (e.g., the HDL source code 2400 resides in a temporary file used by the toolset for the synthesizing step following the compiling step). Further still, as shown in FIG. 25( b), the high level code 2502 may also be directly synthesized at step 2506 to the gate level code 2404.

As would be readily understood by those having ordinary skill in the art, the process flows of FIGS. 24 and 25( a)-(b) can not only be used to generate configuration templates for FPGAs, but also for other hardware logic devices, such as other reconfigurable logic devices and ASICs.

While the present invention has been described above in relation to its preferred embodiments, various modifications may be made thereto that still fall within the invention's scope. Such modifications to the invention will be recognizable upon review of the teachings herein. Accordingly, the full scope of the present invention is to be defined solely by the appended claims and their legal equivalents. 

1. A device comprising: an integrated circuit comprising a key-based block cipher circuit, the integrated circuit configured to (1) perform encryption/decryption using the block cipher circuit, and (2) perform a plurality of different types of key management functions.
 2. The device of claim 1 wherein the block cipher circuit comprises a hardware logic circuit.
 3. The device of claim 1 wherein the block cipher circuit comprises a plurality of pipelined rounds, and wherein the block cipher circuit is scalable with respect to how many of the rounds are active and how many passes through the rounds are needed to encrypt a data block.
 4. The device of claim 3 wherein the scalable block cipher circuit is run-time scalable with respect to how many of the rounds are active and how many passes through the rounds are needed to encrypt a data block.
 5. The device of claim 1 wherein the integrated circuit includes an encryption mode wrapper circuit in communication with the block cipher circuit, the encryption mode wrapper circuit being configured to perform a selectable mode for encryption.
 6. The device of claim 1 wherein the integrated circuit is further configured to perform the plurality of different types of key management functions with at least one hardware logic circuit.
 7. The device of claim 6 wherein the at least one hardware logic circuit is configured to provide key rotation as one of the key management functions.
 8. The device of claim 7 wherein the integrated circuit further comprises a memory buffer to which only the integrated circuit has access, and wherein the integrated circuit is further configured to provide the key rotation by (1) decrypting an encrypted data unit with the block cipher circuit using a first key to thereby generate plaintext, (2) storing the plaintext in the memory buffer, (3) reading the plaintext out of the memory buffer, and (4) encrypting the read plaintext with the block cipher circuit using a second key to thereby generate a newly encrypted data unit.
 9. The device of claim 8 wherein the integrated circuit is further configured to change an encryption mode for the newly encrypted data unit as part of the key rotation.
 10. The device of claim 8 wherein the memory buffer comprises a volatile memory buffer.
 11. The device of claim 6 wherein the at least one hardware logic circuit is configured to provide key generation as one of the key management functions.
 12. The device of claim 11 wherein the integrated circuit comprises a randomizer circuit configured for generating keys.
 13. The device of claim 11 wherein the integrated circuit comprises a cryptographic hash circuit for generating keys.
 14. The device of claim 11 wherein the integrated circuit comprises a memory buffer for storing a plurality of keys in a key table, and wherein the integrated circuit is further configured to store a generated key in the key table at a specified destination index.
 15. The device of claim 6 wherein the at least one hardware logic circuit is configured to provide key selection as one of the key management functions.
 16. The device of claim 6 wherein the at least one hardware logic circuit is configured to provide key authentication as one of the key management functions.
 17. The device of claim 16 wherein the integrated circuit comprises a cryptographic hash circuit for authenticating keys.
 18. The device of claim 6 wherein the at least one hardware logic circuit is configured to provide key distribution as one of the key management functions.
 19. The device of claim 18 wherein the integrated circuit comprises: a memory buffer for storing a plurality of keys in a key table; and wherein the integrated circuit is configured to transfer keys out of the key table.
 20. The device of claim 19 wherein the integrated circuit is further configured to transfer keys out of the key table by (1) reading a key encryption key (KEK) from a register, (2) reading a key from the key table, (3) encrypting the read key with the block cipher circuit using the read KEK, and (4) distributing the encrypted key to a destination outside the integrated circuit.
 21. The device of claim 6 wherein the at least one hardware logic circuit is configured to provide key storage as one of the key management functions.
 22. The device of claim 21 wherein the integrated circuit comprises a memory buffer for storing a plurality of keys in a key table, and wherein the key table is configured to associate key meta-data with a plurality of the stored keys, the key meta-data comprising at least two selected from the group consisting of a key size, a key timestamp, an encryption mode, a data unit size, and an additional mode key.
 23. The device of claim 6 wherein the at least one hardware logic circuit is configured to provide key loading as one of the key management functions.
 24. The device of claim 23 wherein the integrated circuit comprises: an interface to an external non-volatile memory in which a plurality of keys are stored; and a memory buffer for storing a plurality of keys in a key table; and wherein the integrated circuit is configured to load keys into the key table from the external non-volatile memory through the interface.
 25. The device of claim 24 wherein the integrated circuit is further configured to perform the key loading by (1) reading an encrypted key from the external non-volatile memory using the interface, (2) decrypting the encrypted key with the block cipher circuit using a key encryption key (KEK), and (3) loading the decrypted key into the key table.
 26. The device of claim 25 wherein the integrated circuit is further configured to (1) derive the KEK from a pass-phrase, and (2) verify the derived KEK.
 27. The device of claim 23 wherein the integrated circuit is further configured to provide for loading symmetric keys via public key cryptography.
 28. The device of claim 1 wherein the integrated circuit further comprises volatile memory for storing keys.
 29. The device of claim 1 wherein the integrated circuit further comprises volatile memory for storing intermediate plaintext.
 30. A method comprising: performing key-based encryption/decryption within an integrated circuit using a block cipher circuit; and performing a plurality of different types of key management functions within the integrated circuit.
 31. The method of claim 30 wherein the block cipher circuit comprises a hardware logic circuit.
 32. The method of claim 30 wherein the block cipher circuit comprises a plurality of pipelined rounds, the method further comprising: scaling the block cipher circuit with respect to how many of the rounds are active and how many passes through the rounds are needed to encrypt a data block.
 33. The method of claim 32 further comprising performing the scaling step at run-time.
 34. The method of claim 30 further comprising selecting a mode for encryption via an encryption mode wrapper circuit within the integrated circuit.
 35. The method of claim 30 wherein the step of performing a plurality of different types of key management functions comprises performing the plurality of different types of key management functions with at least one hardware logic circuit within the integrated circuit.
 36. The method of claim 35 wherein the step of performing a plurality of different types of key management functions comprises providing key rotation as one of the key management functions.
 37. The method of claim 35 wherein the step of performing a plurality of different types of key management functions comprises providing key generation as one of the key management functions.
 38. The method of claim 35 wherein the step of performing a plurality of different types of key management functions comprises providing key selection as one of the key management functions.
 39. The method of claim 35 wherein the step of performing a plurality of different types of key management functions comprises providing key authentication as one of the key management functions.
 40. The method of claim 35 wherein the step of performing a plurality of different types of key management functions comprises providing key distribution as one of the key management functions.
 41. The method of claim 35 wherein the step of performing a plurality of different types of key management functions comprises providing key storage as one of the key management functions.
 42. The method of claim 35 wherein the step of performing a plurality of different types of key management functions comprises providing key loading as one of the key management functions.
 43. The method of claim 30 further comprising storing intermediate plaintext in volatile memory within the integrated circuit.
 44. A computer-readable medium comprising: a data structure comprising logic for (1) performing key-based encryption/decryption using a block cipher circuit, and (2) performing a plurality of different types of key management functions, wherein the data structure is configured for loading on an integrated circuit to define a hardware logic circuit that realizes the block cipher circuit and a capability to perform the plurality of different types of key management functions, and wherein the data structure is resident on the computer-readable medium.
 45. A system comprising: a system interface circuit configured as a protocol bridge for receiving and outputting data; a direct memory access (DMA) engine circuit in communication with the system interface circuit, the DMA engine circuit configured to transfer data to and from an integrated circuit via DMA; a data routing and control circuit in communication with the DMA engine circuit, the data routing and control circuit configured to process a plurality of control commands and control a plurality of encryption and decryption operations based at least in part on the processed control commands; a block cipher circuit in communication with the data routing and control circuit, the block cipher circuit being configured to perform a key-based encryption operation or a key-based decryption operation on data as specified by the data routing and control circuit; a data buffer in communication with the data routing and control circuit; a key table in communication with the data routing and control circuit, the key table being configured to store a plurality of keys; a key management processor in communication with the data routing and control processor; and a key management function circuit in communication with the data routing and control processor; wherein the interface circuit, the DMA engine circuit, the data routing and control circuit, the block cipher circuit, the data buffer, the key table, the key management processor, and the key management function circuit are all resident on the integrated circuit; wherein the key management processor is configured to provide a plurality of different types of key management functions in conjunction with the key management function circuit; wherein the data routing and control circuit is further configured to control a routing of data and keys to and from the block cipher circuit, the key table, and the data buffer as needed to perform encryption, decryption, and key management; and wherein the data routing and control circuit is further configured to store any intermediate plaintext generated during an encryption or decryption operation in the data buffer.
 46. The system of claim 45 further comprising an encryption mode wrapper circuit in communication with the block cipher circuit and the data routing and control circuit, wherein the encryption mode wrapper circuit is configured to perform an encryption mode operation on data in response to a command from the data routing and control circuit.
 47. The system of claim 45 wherein the block cipher circuit comprises a symmetric key block cipher circuit, the symmetric key block cipher circuit comprising a processing pipeline, the processing pipeline comprising a plurality of round circuits, and wherein the symmetric key block cipher circuit is run-time scalable with respect to (1) how many of the round circuits are active when encrypting or decrypting data, and (2) how many passes through the round circuits are needed to encrypt or decrypt data.
 48. The system of claim 45 wherein the integrated circuit serves as a cryptographic domain bridge for data flowing across a domain boundary between a plurality of different cryptographic domains.
 49. The system of claim 45 further comprising an interface circuit to an external key storage device, the interface circuit to the external key storage device being in communication with the data routing and control circuit.
 50. The system of claim 45 wherein the data buffer comprises volatile memory that is not accessible from outside the integrated circuit.
 51. A device comprising: an integrated circuit comprising a scalable block cipher circuit, the integrated circuit configured to perform encryption/decryption using the scalable block cipher circuit, the scalable block cipher circuit comprising a hardware logic circuit.
 52. The device of claim 51 wherein the block cipher circuit comprises a symmetric key block cipher circuit.
 53. The device of claim 52 wherein the block cipher circuit comprises a processing pipeline, the processing pipeline comprising a plurality of round circuits, and wherein the block cipher circuit is scalable with respect to how many of the round circuits are active when encrypting or decrypting data.
 54. The device of claim 53 wherein the block cipher circuit is further scalable with respect to how many passes through the round circuits are needed to encrypt or decrypt data.
 55. The device of claim 54 wherein the block cipher circuit is configured to be run-time scalable with respect to (1) how many of the round circuits are active when encrypting data, and (2) how many passes through the round circuits are needed to encrypt data.
 56. The device of claim 55 wherein the block cipher circuit comprises: a feedback bus connecting an output of at least a plurality of the round circuits and an entry into the pipeline; and an output bus connecting an output of at least a plurality of the round circuits and an exit from the pipeline.
 57. The device of claim 56 wherein the feedback bus comprises a first feedback bus for a data state and a second feedback bus for a round key.
 58. The device of claim 57 further comprising a control circuit configured to control which data state and which round key are driven to the first and second feedback buses.
 59. The device of claim 56 wherein the block cipher circuit is further configured to selectively deliver both new data for encryption and feedback data from the feedback bus to a first round circuit of the pipeline, and wherein the block cipher circuit is further configured to give priority to the feedback data over the new data when both are competing for access to the first round circuit.
 60. The device of claim 55 wherein the block cipher circuit is further configured to provide fixed time slot scheduling to control a delivery of data to a first round circuit of the pipeline.
 61. The device of claim 55 wherein the block cipher circuit is configured to use the same round circuits for both encryption and decryption.
 62. The device of claim 61 wherein each round circuit comprises a byte substitution stage circuit, a row shifting stage circuit, a round key addition stage circuit, and a column mixing stage circuit, all arranged in a pipelined order, and wherein each round circuit is configured to vary the order of the round key addition stage circuit and the column mixing stage circuit based at least in part on whether that round circuit is to be used for encryption or decryption.
 63. The device of claim 62 wherein each round circuit is further configured to disable the column mixing circuit when that round circuit serves as a final round for an encryption or decryption operation.
 64. The device of claim 63 wherein the byte substitution stage circuit and the row shifting stage circuit are combined into a single stage circuit.
 65. The device of claim 63 wherein each round circuit further comprises: a first multiplexer upstream from the round key addition stage circuit; a second multiplexer upstream from the column mixing stage circuit; and a third multiplexer downstream from the round key addition stage circuit and the column mixing stage circuit; wherein the first multiplexer is configured to selectively deliver (i) upstream data from that round circuit and (ii) feedback data from an output of the column mixing stage circuit to the input for the round key addition stage circuit; wherein the second multiplexer is configured to selectively deliver (i) upstream data from that round circuit and (ii) feedback data from an output of the round key addition stage circuit to the input for the column mixing stage circuit; and wherein the third multiplexer is configured to selectively deliver (i) data from the output of the column mixing stage circuit and (ii) data from the output of the round key addition stage circuit to an output for that round circuit.
 66. The device of claim 62 wherein at least a plurality of the round circuits are further configured to perform key expansion upstream from the round key addition stage circuit.
 67. The device of claim 62 wherein the block cipher circuit further comprises a round key addition circuit upstream from a first round circuit in the pipeline.
 68. A method comprising: performing encryption/decryption by processing data with a scalable block cipher circuit that is implemented as a hardware logic circuit.
 69. The method of claim 68 wherein the block cipher circuit comprises a symmetric key block cipher circuit.
 70. The method of claim 69 wherein the block cipher circuit comprises a processing pipeline, the processing pipeline comprising a plurality of round circuits, the method further comprising scaling the block cipher circuit with respect to how many of the round circuits are active when encrypting or decrypting data.
 71. The method of claim 70 further comprising scaling the block cipher circuit with respect to how many passes through the round circuits are needed to encrypt or decrypt data.
 72. The method of claim 71 wherein the scaling steps comprise performing the scaling steps at run-time.
 73. The method of claim 72 further comprising: feeding back an output of at least a plurality of the round circuits to an entry into the pipeline; and selectively outputting a plurality of outputs from the round circuits to an exit from the pipeline via an output bus.
 74. The method of claim 73 further comprising selectively delivering both new data for encryption and feedback data from the feeding back step to a first round circuit of the pipeline, and wherein the selectively delivering step gives priority to the feedback data over the new data when both are competing for access to the first round circuit.
 75. The method of claim 72 further comprising using the same round circuits for both encryption and decryption.
 76. The method of claim 75 further comprising; performing, in a pipelined manner within each round circuit, (i) a byte substitution operation, (ii) a row shifting operation, (iii) a round key addition operation, and (iv) a column mixing operation; and varying an order in which the round key addition and column mixing operations are performed based at least in part on whether that round circuit is to be used for encryption or decryption.
 77. The method of claim 76 further comprising: disabling the column mixing operation for a round circuit when that round circuit serves as a final round for an encryption or decryption operation.
 78. The method of claim 76 further comprising: performing key expansion with a round circuit before the round key addition operation.
 79. The method of claim 76 further comprising: performing a round key addition operation upstream from a first round circuit in the pipeline.
 80. A computer-readable medium comprising: a data structure comprising logic for performing encryption/decryption using a scalable block cipher circuit, wherein the data structure is configured for loading on an integrated circuit to define a hardware logic circuit that realizes the scalable block cipher circuit, and wherein the data structure is resident on the computer-readable medium.
 81. A device comprising: an integrated circuit comprising a block cipher circuit, the integrated circuit configured to perform encryption and decryption using the block cipher circuit, the block cipher circuit comprising a processing pipeline, the processing pipeline comprising a plurality of round circuits, and wherein the block cipher circuit is configured to use the same round circuits for both encryption and decryption.
 82. The device of claim 81 wherein the block cipher circuit comprises a symmetric key block cipher circuit.
 83. The device of claim 82 wherein the block cipher circuit comprises a hardware logic circuit.
 84. The device of claim 83 wherein each round circuit comprises a byte substitution stage circuit, a row shifting stage circuit, a round key addition stage circuit, and a column mixing stage circuit, all arranged in a pipelined order, and wherein each round circuit is configured to vary the order of the round key addition stage circuit and the column mixing stage circuit based at least in part on whether that round circuit is to be used for encryption or decryption.
 85. The device of claim 84 wherein each round circuit is further configured to disable the column mixing circuit when that round circuit serves as a final round for an encryption or decryption operation.
 86. The device of claim 85 wherein the byte substitution stage circuit and the row shifting stage circuit are combined into a single stage circuit.
 87. The device of claim 85 wherein each round circuit further comprises: a first multiplexer upstream from the round key addition stage circuit; a second multiplexer upstream from the column mixing stage circuit; and a third multiplexer downstream from the round key addition stage circuit and the column mixing stage circuit; wherein the first multiplexer is configured to selectively deliver (i) upstream data from that round circuit and (ii) feedback data from an output of the column mixing stage circuit to the input for the round key addition stage circuit; wherein the second multiplexer is configured to selectively deliver (i) upstream data from that round circuit and (ii) feedback data from an output of the round key addition stage circuit to the input for the column mixing stage circuit; and wherein the third multiplexer is configured to selectively deliver (i) data from the output of the column mixing stage circuit and (ii) data from the output of the round key addition stage circuit to an output for that round circuit.
 88. The device of claim 84 wherein at least a plurality of the round circuits are further configured to perform key expansion upstream from the round key addition stage circuit.
 89. The device of claim 84 wherein the block cipher circuit further comprises a round key addition circuit upstream from a first round circuit in the pipeline.
 90. A method comprising: performing encryption and decryption using a block cipher circuit, the block cipher circuit comprising a processing pipeline, the processing pipeline comprising a plurality of round circuits, and wherein the performing step comprises using the same round circuits for both encryption and decryption.
 91. The method of claim 90 wherein the block cipher circuit comprises a symmetric key block cipher circuit.
 92. The method of claim 91 wherein the block cipher circuit comprises a hardware logic circuit.
 93. The method of claim 92 further comprising; performing, in a pipelined manner within each round circuit, (i) a byte substitution operation, (ii) a row shifting operation, (iii) a round key addition operation, and (iv) a column mixing operation; and varying an order in which the round key addition and column mixing operations are performed based at least in part on whether that round circuit is to be used for encryption or decryption.
 94. The method of claim 93 further comprising: disabling the column mixing operation for a round circuit when that round circuit serves as a final round for an encryption or decryption operation.
 95. The method of claim 93 further comprising: performing key expansion with a round circuit before the round key addition operation.
 96. The method of claim 93 further comprising: performing a round key addition operation upstream from a first round circuit in the pipeline.
 97. A computer-readable medium comprising: a data structure comprising logic for a block cipher circuit, the block cipher circuit comprising a processing pipeline, the processing pipeline comprising a plurality of round circuits, wherein the block cipher circuit is configured to use the same round circuits for both encryption and decryption, wherein the data structure is configured for loading on an integrated circuit to define a hardware logic circuit that realizes the block cipher circuit, and wherein the data structure is resident on the computer-readable medium.
 98. A device comprising: a block cipher circuit; and an encryption mode wrapper circuit in communication with the block cipher circuit; wherein the encryption mode wrapper circuit is configured to provide an encryption mode for an encryption operation to be performed at least in part using the block cipher circuit; wherein the encryption mode wrapper circuit is further configured to define the encryption mode in response to a control signal; and wherein the block cipher circuit and the encryption mode circuit are implemented as hardware logic circuits within an integrated circuit.
 99. The device of claim 98 wherein the encryption mode circuit is further configured to (1) provide any of a plurality of different available encryption modes for the encryption operation, and (2) select one of the encryption modes for the encryption operation in response to the control signal.
 100. The device of claim 99 wherein the plurality of different available encryption modes comprises at least two selected from the group consisting of a tweakable storage cipher encryption mode, a CBC encryption mode, a CTR encryption mode, and an ECB encryption mode.
 101. The device of claim 99 wherein the encryption mode wrapper circuit is configured with a plurality of different mode circuits in parallel, and wherein each of the different mode circuits are configured to operate on all data received by the encryption mode circuit, and wherein the encryption mode circuit is configured to pass an output from a selected one of the different mode circuits in response to the control signal.
 102. The device of claim 99 wherein the encryption mode wrapper circuit is configured with a plurality of different mode circuits in parallel, and wherein the control signal includes an enable signal that defines which of the parallel mode circuits will be active for a given encryption operation.
 103. The device of claim 98 wherein the encryption mode wrapper circuit comprises a XTS mode circuit, the XTS mode circuit being configured to utilize the block cipher circuit to provide an XTS encryption mode, and the XTS mode circuit comprising a scheduler circuit configured to schedule access to the block cipher circuit for the XTS mode circuit.
 104. The device of claim 98 wherein block cipher circuit comprises a first block cipher circuit, the encryption mode wrapper circuit comprises a XTS mode circuit, the XTS mode circuit comprising a second block cipher circuit, the XTS mode circuit being configured to utilize the second block cipher circuit to provide an XTS encryption mode.
 105. The device of claim 98 wherein the encryption mode wrapper circuit comprises a XTS mode circuit, the XTS mode circuit being configured to precompute a tweak value for the XTS encryption mode. 